<%-- 
    Document   : userAdd
    Created on : Feb 22, 2015, 3:16:25 PM
    Author     : Kim
--%>

<%@ include file="/common/header.jsp"%>

<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Master User</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Form User
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-12">
                            <form:form id="saveForm" name="saveForm" method="post" modelAttribute="user">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">Kode User</label>
                                    <input class="form-horizontal" type="text" id="kodeUser" name="kodeUser"
                                           <c:if test="${not empty user}">value="<c:out value='${user.kodeUser}' />" readonly="true"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Display Name</label>
                                        <input class="form-horizontal" type="text" id="displayName" name="displayName"
                                        <c:if test="${not empty user}">value="<c:out value='${user.displayName}' />"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Email User</label>
                                        <input class="form-horizontal" type="text" id="emailuser" name="emailuser"
                                        <c:if test="${not empty user}">value="<c:out value='${user.emailuser}' />"</c:if> />
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">First Name</label>
                                        <input class="form-horizontal" type="text" id="firstName" name="firstName" 
                                        <c:if test="${not empty user}">value="<c:out value='${user.firstName}' />"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Last Name</label>
                                        <input class="form-horizontal" type="text" id="lastName" name="lastName" 
                                        <c:if test="${not empty user}">value="<c:out value='${user.lastName}' />"</c:if> />
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Gender User</label>
                                        <select class="form-horizontal" name="gender">
                                            <option value="Pria" <c:if test="${user.gender == 'Pria'}">selected="yes"</c:if>> Pria </option>
                                            <option value="Wanita" <c:if test="${user.gender == 'Wanita'}">selected="yes"</c:if>> Wanita </option>
                                        </select>
                                    </div>
                                    
                                     <div class="form-group">
                                        <label class="col-sm-2 control-label">User Type</label>
                                        <input class="form-horizontal" type="text" id="userType" name="userType"
                                        <c:if test="${not empty user}">value="<c:out value='${user.userType}' />"</c:if> />
                                    </div>
                                     <div class="form-group">
                                        <label class="col-sm-2 control-label">Password User</label>
                                        <input class="form-horizontal" type="password" id="passwordUser" name="passwordUser"
                                        <c:if test="${not empty user}">value="<c:out value='${user.passwordUser}' />"</c:if> />
                                    </div>
                                    <div class="form-group" >
                                        <div class="col-sm-offset-2 col-sm-6" style="padding-top: 10px">
                                        <c:if test="${empty user}">
                                            <input type="button" value=" Simpan " class="btn btn-primary" onclick="functionSave('<c:url value="/page/userAdd.html" />');" />
                                        </c:if>
                                        <c:if test="${not empty user}">
                                            <input type="button" value=" Simpan " class="btn btn-primary" onclick="functionSave('<c:url value="/page/userUpdate.html" />');" />
                                        </c:if>
                                        <input type="button" value=" Batal " class="btn btn-default" onclick="backList('<c:url value="/page/userView.html" />');" /> 
                                    </div>
                                </div>
                            </form:form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%@ include file="/common/footer.jsp"%>